<%@page import="com.google.appengine.api.utils.SystemProperty"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="user" class="model.User" scope="session" />
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
	var _gaq = _gaq || [];
	_gaq.push([ '_setAccount', 'UA-21940965-2' ]);
	_gaq.push([ '_trackPageview' ]);

	(function() {
		var ga = document.createElement('script');
		ga.type = 'text/javascript';
		ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl'
				: 'http://www')
				+ '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0];
		s.parentNode.insertBefore(ga, s);
	})();
</script>
<style type="text/css">
div.pos_fixed {
	position: relative;
	left: 40%;
	position: fixed;
	bottom: 20px;
}
</style>
<title>Prijavljivanje</title>
</head>
<body>
	<h1>Prijavljivanje na sistem</h1>

	<%
		if (user == null || !user.isLoggedIn()) {
	%>
	<form action="/logIn" method="post">
		<table cellspacing=0 cellpadding=3 border=0>
			<tr>
				<td align=right>Korisničko ime:</td>
				<td><input type="text" name="username"></td>
			</tr>
			<tr>
				<td align=right>Šifra:</td>
				<td><input type="password" name="password"></td>
			</tr>
			<tr>
				<td align=right>&nbsp;</td>
				<td><input type="submit" value=" Prijavljivanje"></td>
			</tr>
		</table>
		<h2>${msg}</h2>
	</form>
	<%
		} else {
			if(user.isAdmin()){
	%>
	<p>
		Već ste se prijavili! <br> [<a href="/admin">Pregled
			reda voznje</a>]
	</p>

	<%
		}else{
	%>

	<p>
		Već ste se prijavili! <br> [<a href="/timeTableServlet">Pregled
			reda voznje</a>]
	</p>

	<%
		}
	%>

	[
	<a href="/logIn?logOff=true">Odjavi se</a>]

	<%
		}
	%>

	<div class="pos_fixed" align="center">
		<!-- id aplikacije -->
		<%=SystemProperty.applicationId.get()%>,
		<!-- Na appspotu ili u lokalu -->
		<%=SystemProperty.environment.value()%>,
		<!-- Verzija nase aplikacije -->
		ver:
		<%=SystemProperty.applicationVersion.get()%>,
		<!-- Verzija Google App Engine okruzenja -->
		<%=SystemProperty.version.get()%>
	</div>
</body>
</html>
